Skip to content

sample(auth): full customization demo - #2414

Open
demolaf wants to merge 16 commits into
version-10.0.0-beta05from
sample/full-customization-method-picker
Open

sample(auth): full customization demo#2414
demolaf wants to merge 16 commits into
version-10.0.0-beta05from
sample/full-customization-method-picker

Conversation

@demolaf

@demolaf demolaf commented Jul 22, 2026

Copy link
Copy Markdown
Member

Extends the full customization demo so the sample supplies a custom UI for every FirebaseAuthScreen slot: emailContent, phoneContent, mfaEnrollmentContent (factor choice, SMS, TOTP, verification), mfaChallengeContent, reauthContent and authenticatedContent.

The authenticated screen mostly exists to make the others reachable — "Set up two-factor" navigates into enrollment, and changing the password runs through authUI.withReauth, which is what provokes the reauth slot.

  • screens/AuthMethodPickerUI.kt hosts the primary email flow on its own Navigation 3 back stack — one route per EmailAuthMode plus the demo's own EmailEntryKey — instead of swapping state.mode inside a single screen. That is what gives the email steps real transitions, a working predictive-back gesture, and an address that survives moving between them.
  • screens/reauth/ is two screens. ReauthUI.kt is the provider chooser (ReauthContentState.providers arrives already filtered to the providers linked to this user). ReauthEmailStep.kt is a compact "Confirm it's you", because the library composes the reauth email step inside a ModalBottomSheet — the full sign-in page does not fit there, and its sign-up and email-link affordances are switched off in reauth anyway.
  • MainActivity.kt routes a returning email link back to whichever demo sent it, keyed on a path segment each demo puts on its continue URL. Path rather than query: ContinueUrlBuilder appends ? unconditionally, which would corrupt an existing query string. FullCustomizationDemoActivity now consumes EXTRA_EMAIL_LINK so the link can complete there.
  • A declined reauthentication is treated as a cancellation rather than a failure, following the withReauth contract in this stack — backing out of the sheet no longer reports "couldn't change the password".
  • common/AuthPage.kt: shared page frame (mascot, headline, card, bottom actions) for the MFA, reauth and authenticated screens, so their background, scrolling and inset behaviour match the email and phone steps.
  • Also addresses review feedback on the existing screens: the other-sign-in-methods sheet scrolls (nine providers plus the ToS footer overflowed shorter screens), and the confirmation email is compared trimmed and case-insensitively.

Preview

  • Full Customization Flow
1-signin-signup-phone.mp4
  • Email Link Sign In Flow
2-email-link-signin.mp4
  • Reauthentication Flow
5-reauth.mp4
  • MFA Flow (Enrollment)
3-authenticated-mfa-enrollment.mp4
  • MFA Flow (Challenge)
4-mfa-challenge.mp4
  • Error Dialog (Inherits font change)
Screenshot_1784723834

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a fully customized authentication flow demo (FullCustomizationDemoActivity and associated steps) to showcase the capabilities of customMethodPickerLayout in FirebaseAuthScreen, alongside minor inset adjustments in the default auth screens. The review feedback is highly constructive and should be addressed: it recommends implementing a BackHandler for proper step-back navigation, making the alternative sign-in methods sheet scrollable to prevent clipping on smaller screens, passing the FirebaseAuth instance dynamically to support custom configurations, performing case-insensitive and trimmed email validation, and ensuring the loading indicator in CtaButton has sufficient contrast.

@demolaf
demolaf changed the base branch from sample/firestore-database-storage to fix/mfa-edge-to-edge-insets July 22, 2026 13:02
@demolaf
demolaf changed the base branch from fix/mfa-edge-to-edge-insets to sample/firestore-database-storage July 22, 2026 13:03
@demolaf demolaf added the sample label Jul 22, 2026
@demolaf demolaf changed the title sample(auth): flesh out full customization demo with email/login/sign… sample(auth): flesh out full customization demo Jul 22, 2026
@demolaf demolaf changed the title sample(auth): flesh out full customization demo sample(auth): full customization demo Jul 22, 2026
@demolaf
demolaf force-pushed the sample/firestore-database-storage branch from 0cdfacd to 1778d6c Compare July 27, 2026 10:46
@demolaf
demolaf force-pushed the sample/full-customization-method-picker branch from e98fb6e to cbbd262 Compare July 28, 2026 16:01
@demolaf
demolaf changed the base branch from sample/firestore-database-storage to version-10.0.0-beta04 July 28, 2026 16:03
@demolaf
demolaf changed the base branch from version-10.0.0-beta04 to fix/auth-state-stale-notification-reset July 28, 2026 16:03
@demolaf demolaf closed this Jul 28, 2026
@demolaf
demolaf force-pushed the sample/full-customization-method-picker branch from ccd214c to 267731e Compare July 28, 2026 16:08
@github-project-automation github-project-automation Bot moved this from Backlog to Done in studio-2394994192-60a69 Jul 28, 2026
@demolaf demolaf reopened this Jul 28, 2026
@demolaf
demolaf force-pushed the fix/auth-state-stale-notification-reset branch from 267731e to e035a60 Compare July 29, 2026 00:45
@demolaf
demolaf force-pushed the sample/full-customization-method-picker branch from 74c0370 to 007676d Compare August 10, 2026 16:40
@demolaf
demolaf changed the base branch from fix/auth-state-stale-notification-reset to version-10.0.0-beta04 August 10, 2026 16:43
@demolaf
demolaf force-pushed the version-10.0.0-beta04 branch from dbaac07 to f896825 Compare August 18, 2026 09:55
@demolaf
demolaf force-pushed the sample/full-customization-method-picker branch from d552549 to a2d2bc9 Compare August 21, 2026 14:06
@demolaf
demolaf marked this pull request as ready for review August 21, 2026 14:58
@demolaf
demolaf force-pushed the version-10.0.0-beta04 branch from 06a6fe9 to 697f1d9 Compare August 24, 2026 09:29
@demolaf
demolaf force-pushed the sample/full-customization-method-picker branch from 4785c0e to 5e3a069 Compare August 24, 2026 10:16
@demolaf
demolaf marked this pull request as draft August 25, 2026 09:46
@demolaf
demolaf force-pushed the sample/full-customization-method-picker branch from 5e3a069 to ba5b475 Compare August 29, 2026 22:02
@demolaf
demolaf changed the base branch from version-10.0.0-beta04-old to version-10.0.0-beta05 August 29, 2026 22:02
@demolaf
demolaf force-pushed the sample/full-customization-method-picker branch 2 times, most recently from 875cf50 to 1c0c935 Compare August 31, 2026 22:36
@demolaf
demolaf marked this pull request as ready for review September 2, 2026 18:36
@demolaf
demolaf force-pushed the sample/full-customization-method-picker branch from 8176916 to 48d81bf Compare September 3, 2026 15:03
@demolaf
demolaf force-pushed the version-10.0.0-beta05 branch from dfab195 to 0a1fbd7 Compare September 6, 2026 10:55
@demolaf
demolaf force-pushed the sample/full-customization-method-picker branch from 48d81bf to cd928ef Compare September 7, 2026 01:33
@demolaf
demolaf changed the base branch from version-10.0.0-beta05 to fix/email-link-sign-in-confirmation September 7, 2026 01:34
@demolaf
demolaf force-pushed the fix/email-link-sign-in-confirmation branch from 9118458 to b79fec3 Compare September 7, 2026 10:40
@demolaf
demolaf force-pushed the sample/full-customization-method-picker branch from cd928ef to 4873a4b Compare September 7, 2026 10:40
@demolaf
demolaf force-pushed the fix/email-link-sign-in-confirmation branch 4 times, most recently from f6fd6a7 to 2371997 Compare September 7, 2026 15:25
@demolaf
demolaf force-pushed the sample/full-customization-method-picker branch from 4873a4b to 655328c Compare September 7, 2026 18:56
@demolaf
demolaf changed the base branch from fix/email-link-sign-in-confirmation to version-10.0.0-beta05 September 9, 2026 10:34
demolaf and others added 15 commits September 9, 2026 12:10
(cherry picked from commit d88088103e61630c95f69de273953346b90486ab)
…-state UI to full customization demo

(cherry picked from commit 96694e0dddd4dacaa769d09ee153c34d4f51f8a2)
Intercept back on the login/sign-up steps so it returns to email entry
instead of leaving the auth flow, make the other-sign-in-methods sheet
scrollable (nine providers plus the ToS footer overflow shorter screens),
compare the confirmation email trimmed and case-insensitively and give the
field an email keyboard, and take the configured FirebaseAuth instance
rather than reaching for the global default.

(cherry picked from commit 1dfdeda82ecce93f6af54f4dfd6371d108c0ca44)
…ntState

(cherry picked from commit 20681c413ada0394de19203bb2dde2784bac6d06)
@demolaf
demolaf force-pushed the sample/full-customization-method-picker branch from f7fed0e to c7ddaee Compare September 9, 2026 11:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant